Skip to content

Add some Localization, Language Switcher, Window Persistence, and UI Improvements (v1.0.1.0)#71

Open
syahdafahreza wants to merge 5 commits into
voidtools:masterfrom
syahdafahreza:master
Open

Add some Localization, Language Switcher, Window Persistence, and UI Improvements (v1.0.1.0)#71
syahdafahreza wants to merge 5 commits into
voidtools:masterfrom
syahdafahreza:master

Conversation

@syahdafahreza

Copy link
Copy Markdown

This Pull Request introduces several features, improvements, and bug fixes to enhance the user experience and expand accessibility. I have also bumped the version to 1.0.1.0 across all components.

Key Changes:

1. Localization & Language Support

  • Indonesian Translation: Added full Indonesian (id-ID) localization support via src/localization_id_id.h.
  • Language Switcher: Added a manual language selection dropdown in Options > General, allowing users to override system defaults.
  • Unique Resource IDs: Assigned unique IDs to previously generic IDC_STATIC labels in the resource file. This enables dynamic localization of all UI elements without falling back to hardcoded English strings.

2. Window Management & Persistence

  • Remember Window State: The application now persists and restores the last window position (X/Y), dimensions (Width/Height), and maximized state.
  • Reset Window Button: Added a "Reset Window Size & Position" button in Options > View to quickly center the window on the current monitor with default dimensions.

3. UI/UX Refinements (Scroll Zoom & Layout)

  • Robust & Smooth Scroll Zoom: Implemented a resolution-aware zoom increment. Small images zoom in finer steps, while high-resolution images maintain fast zooming.
  • Widened Dialog Layout: Increased the width of the Options dialog (from 310 to 360 units) to prevent clipping of long localization strings in various languages.

Code Comparison (Before vs After):

A. Robust & Smooth Scroll Zoom
I refined the zoom logic to be resolution-aware, preventing jumpy zooming on small icons while maintaining speed on high-res photos.

  • Before:
    // src/viv.c (Simple fixed increment)
    if (delta > 0) _viv_zoom_pos++;
    else _viv_zoom_pos--;
  • After:
    // src/viv.c (Resolution-aware dynamic increment)
    int increment = 1;
    // Faster zoom for high-res images (>4MP and >12MP)
    if (_viv_image_wide * (__int64)_viv_image_high > 4000000) increment = 2;
    if (_viv_image_wide * (__int64)_viv_image_high > 12000000) increment = 4;
    
    _viv_zoom_pos += (delta / 120) * increment;

B. Options Dialog Layout (Widened)
Increased the width of the Options dialog to prevent clipping of long localization strings (common in Indonesian and Chinese).

  • Before:
    // res/voidImageViewer.rc
    IDD_OPTIONS DIALOGEX 0, 0, 310, 271
    ...
    CONTROL "",IDC_TAB1,"SysTabControl32",WS_TABSTOP,96,6,210,240
    
  • After:
    // res/voidImageViewer.rc (+50 units width)
    IDD_OPTIONS DIALOGEX 0, 0, 360, 271
    ...
    CONTROL "",IDC_TAB1,"SysTabControl32",WS_TABSTOP,96,6,260,240
    

C. Localizable Static Labels
Assigned unique IDs to static labels that were previously hardcoded as IDC_STATIC, allowing them to be dynamically updated via os_SetDlgItemText_localization_id.

  • Before:
    LTEXT "&Shrink blit mode:",IDC_STATIC,0,0,74,12
    
  • After:
    LTEXT "&Shrink blit mode:",IDC_SHRINK_BLIT_MODE_STATIC,0,0,100,12
    

D. Window Persistence (config.c):

  • Before: (No saving of coordinates)
  • After:
    _config_write_int(h,"x",config_x);
    _config_write_int(h,"language",config_language);
    _config_write_int(h,"y",config_y);
    _config_write_int(h,"wide",config_wide);
    _config_write_int(h,"high",config_high);
    _config_write_int(h,"maximized",config_maximized);

Note to Maintainer:

Please review the changes carefully, particularly the resource ID changes in voidImageViewer.rc and resource.h. I have bumped the version to 1.0.1.0 as these changes introduce new functional features and significant UI improvements. I have tested these changes on Windows 10/11 and they appear stable. However, if any part of this PR does not align with the project's vision, feel free to request changes or decline the PR. Thank you for your time and for maintaining this excellent tool!

syahdafahreza and others added 5 commits May 1, 2026 18:33
Add Indonesian (id_ID) localization and a selectable UI language option. Key changes:
- Add src/localization_id_id.h and register Indonesian in localization arrays; expose localization_get_language_name.
- Add config_language (default = auto) to config.c/.h and persist/load it from settings.
- Add language combobox and related UI strings/controls in resource.h and .rc; include a UTF-8 .rc copy (res/voidImageViewer_utf8.rc).
- Bump application version to 1.0.1.0 (nsis/version.nsh and resource version info) and add scratch_version.ps1 to help update versions.
- Adjust some default config values (store settings in %APPDATA% by default, change navigation sort to name ascending).
- Minor UI layout adjustments and new control IDs for reset window, commands, and keyboard shortcut labels.
- Add auxiliary files: comments.json, issues.json, test_math.c, and update project file (vs2026/voidImageViewer.vcxproj).

These changes add language support and UI elements to let users choose their preferred language and ensure the new strings/resources are included and versioned.
@voidtools

voidtools commented May 4, 2026

Copy link
Copy Markdown
Owner

Thank you for your work on VIV syahdafahreza,

There's a lot of changes here and I will need to go over them.
I will import your Indonesian localization.

I have already adjusted the zoom levels (0.01 - 0.2 curve) and will need more time to review.
The first zoom level always felt too small for 1080p-sized images, so it was skipped.
However, for massive images, this missing zoom level is noticeable.

The window state was already persistent, so I will have to check your changes.

I might move the options dialog size to the translation template.

Thanks again for your work.

@syahdafahreza

Copy link
Copy Markdown
Author

Hi,

Thank you for taking the time to review my PR and for the detailed feedback! I really appreciate it.
Please take all the time you need to go over the changes. I'm glad to hear that the Indonesian localization will be imported.

Just let me know if you need to make any further adjustments or revert any specific commits. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants